//Main
app.controller('orderListConCtr',['$scope','ngDialog', function($scope,ngDialog) {
    
    $scope.logistics = function(orderNo){
        ngDialog.open({
            template: '/admin/view/order/orderList/orderLogisticsDialog.html',
            width: 600,
            controller: 'orderLogisticsDialogCtr',
            resolve: {
                getData: function() {
                    return {
                        orderNo : orderNo
                    };
                }
            }
        });
    };

    $scope.refundAudit = function(row){
        ngDialog.open({
            template: '/admin/view/order/orderList/orderRefundAuditDialog.html',
            width: 600,
            controller: 'orderRefundAuditDialogCtr',
            resolve: {
                getData: function() {
                    return {
                        orderNo : row.orderNo
                    };
                },
                viewData: function(){
                    return {
                        refundReason : row.refundReason
                    }
                }
            }
        });
    };

    $scope.remark = function(row){
        ngDialog.open({
            template: '/admin/view/order/orderList/orderRemarkDialog.html',
            width: 600,
            controller: 'orderRemarkDialogCtr',
            resolve: {
                getData: function() {
                    return {
                        orderNo : row.orderNo,
                        remark : row.remark
                    };
                }
            }
        });
    };

    $scope.delivery = function(row,model){
        ngDialog.open({
            template: '/admin/view/order/orderList/orderDeliveryDialog.html',
            width: 600,
            controller: 'orderDeliveryDialogCtr',
            resolve: {
                rowData: function() {
                    return row;
                },
                addEditModel: function(){
                    return model
                }
            }
        });
    };


    $scope.upLogistics = function(row){
        ngDialog.open({
            template: '/admin/view/order/orderList/orderUpLogisticsDialog.html',
            width: 400,
            controller: 'orderUpLogisticsDialogCtr',
            resolve: {
                getData: function() {
                    return {
                        freight : row.freight,
                        orderNo : row.orderNo
                    }
                }
            }
        });
    };

    $scope.foo = function(page){   //page分页
        $scope.getData.pageNo = page;
        $scope.getListDataFn();
    };
}]);
